package com.example.market.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum ExceptionEnum {
    /* User*/
    GET_USR_PASSWORD_NOT_MATCH(2, "用户名或密码错误"),
    User_Name_Already_Exists(2, "用户名已存在"),
    SAVE_USER_ERROR(2, "注册用户失败"),

    /*Product*/
    GET_PRODUCT_NOT_FOUND(2, "找不到商品"),
    GET_PRODUCT_ERROR(2, "搜索商品失败"),

    /*Category*/
    GET_CATEGORY_NOT_FOUND(2, "类别为空"),
    GET_CATEGORY_ERROR(2, "查找类别失败"),

    /*ProductPicture*/
    GET_PRODUCT_PICTURE_ERROR(2, "商品图片查询失败"),
    GET_PRODUCT_PICTURE_NOT_FOUND(2, "商品图片为空"),

    /*Cart*/
    GET_CART_ERROR(2, "购物车异常"),
    GET_CART_NOT_FOUND(2, "购物车为空"),
    ADD_CART_NUM_UPPER(3, "该商品购物车达到上限"),
    UPDATE_CART_ERROR(3, "商品数量修改失败"),
    DELETE_CART_ERROR(3, "商品删除失败"),

    /*Collect*/
    SAVE_COLLECT_ERROR(2, "收藏失败"),
    SAVE_COLLECT_REUSE(2, "已收藏，请勿重复收藏"),
    GET_COLLECT_NOT_FOUND(2, "尚无商品收藏"),
    GET_COLLECT_ERROR(2, "获取收藏失败"),
    DELETE_COLLECT_ERROR(2, "删除收藏失败"),

    /*Carousel*/
    GET_CAROUSEL_ERROR(2, "轮播图查询失败"),
    GET_CAROUSEL_NOT_FOUND(2, "轮播图为空"),

    /*Order*/
    ADD_ORDER_ERROR(2, "生成订单失败"),
    GET_ORDER_NOT_FOUND(2, "订单为空"),
    GET_ORDER_ERROR(2, "查询订单失败"),

    GET_SECKILL_NOT_FOUND(2, "尚无秒杀商品"),
    GET_SECKILL_IS_OVER(2, "秒杀商品售罄"),
    GET_SECKILL_IS_REUSE(2, "秒杀重复"),
    GET_SECKILL_IS_NOT_START(2, "秒杀尚未开始"),


    ;
    private Integer code;
    private String msg;


}
